define(function(require,exports,module){
    mui.previewImage();
    mui('.mui-bar-tab').on('tap','a',function(){
        location.href = this.getAttribute('href');
    })
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationType: 'fraction'
    });
    $(function(){
        var hei = $(window).height();
        $('#commentPopover').css('height',hei*0.8);
        $('#commentPopover') .find('.pop-top').css('top',hei*0.2);
        // var lay1,lay2;//layer弹出层
        $('.liveroom-main').on('click','.tip_btn',function(){
            var str = `<div class="tipPop mui-text-center">
                    <div class="close-tip"><i class="iconfont icon-cuo"></i></div>
                    <img src="http://resources-user-image.vxue360.com/3265dafb7500ab8594c47fd83075f20f.png?imageMogr2/thumbnail/128x128!" class="img-circle touxiang">
                    <p class="text-18 color-black m-t m-b">打赏某某</p>
                    <p class="t_line"><span><i class="iconfont icon-dashang"></i></span></p>
                    <ul class="num-list clearfix">
                        <li data-num="2">2元</li>
                        <li data-num="5">5元</li>
                        <li data-num="10">10元</li>
                        <li data-num="20">20元</li>
                        <li data-num="50">50元</li>
                        <li data-num="100">100元</li>
                    </ul>
                    <p class="otherNum">其他金额</p>
                    <div class="bottom">
                    </div>
                </div>`;
            //自定页
            lay1 = layer.open({
              type: 1,
              skin: 'tipPop', //样式类名
              closeBtn: 1, //不显示关闭按钮
              anim: 2,
              shadeClose: true, //开启遮罩关闭
              content: str
            });
        });
        $('body').on('click','.close-tip',function(){
            layer.close(layer.index);
        });
        $('body').on('click','.num-list li',function(){

        })
        $('body').on('click','.otherNum',function(){
            var str = `<div class="otherNumPop mui-text-center">
                <div class="close-tip"><i class="iconfont icon-cuo"></i></div>
                <p class="text-14 color-333">其他金额</p>
                <div class="o_input color-333">
                    <p>金额(元): <input type="text" id="otherMoney" placeholder="可填写2-1000元" name=""></p>
                </div>
                <button>确定</button>
                <div class="bottom">
                </div>
            </div>`;
            lay2 = layer.open({
              type: 1,
              skin: 'tipPop', //样式类名
              closeBtn: 1, //不显示关闭按钮
              anim: 2,
              shadeClose: true, //开启遮罩关闭
              content: str
            });
        })
        $('#topShow').on('click',function(){
            $('.liveroom_stop').toggle();
            if($('.liveroom_stop').is(':hidden')){
                $('.liveroom-main').css('padding-top','53px');
                $(this).text('展开');
            }else{
                $('.liveroom-main').css('padding-top','253px');
                $(this).text('收起');
            }
        });
        $('#danmubtn').on('click',function(){
            $('.liveroom-danmu').toggle();
            $(this).toggleClass('icon-danmu icon-danmuguan');
        });
    })

    // 操作块切换
    $(".option-btn").on("tap",function(){
        if($(this).hasClass("active")){

        }else{
            $(".option-btn.active").removeClass("active");
            $(this).addClass("active")
        }
    })
})
